package com.xiaolv.web.service.impl;

import com.xiaolv.web.mapper.SysOperateTableMapper;
import com.xiaolv.web.service.SysOperateTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 数据表创建
 *
 * @author lvlinguang
 * @date 2020-08-22 19:50
 */
@Service
public class SysOperateTableServiceImpl implements SysOperateTableService {

    @Autowired
    private SysOperateTableMapper operateTableMapper;

    /**
     * 判断表是否存在
     *
     * @param tableName 表名
     * @return 存在大于0
     */
    @Override
    public int existTable(String tableName) {
        return operateTableMapper.existTable(tableName);
    }

    /**
     * 删除表
     *
     * @param tableName 表名
     * @return
     */
    @Override
    public int dropTable(String tableName) {
        return operateTableMapper.dropTable(tableName);
    }

    /**
     * 创建日志表
     *
     * @param tableName 表名
     * @return
     */
    @Override
    public int createLogTable(String tableName) {
        return operateTableMapper.createLogTable(tableName);
    }

    /**
     * 创建订单表
     *
     * @param tableName 表名
     * @return
     */
    @Override
    public int createOrderTable(String tableName) {
        return operateTableMapper.createOrderTable(tableName);
    }
}
